package com.google.rui.utils;

import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;

public class CompareUtils {
	/**
	 * 字符串拼音对比
	 * 
	 * @param o1
	 * @param o2
	 * @return
	 */
	public static int StrPinyinCompare(String o1, String o2) {
		return (new PinyinComparator()).compare(o1, o2);
	}

	/**
	 * 汉字字符串对比
	 * 
	 * @author Administrator
	 * 
	 */
	public static class PinyinComparator implements Comparator<String> {

		@Override
		public int compare(String o1, String o2) {
			return Collator.getInstance(Locale.CHINESE).compare(o1, o2);
		}
	}
}
